package tr.richfacesext.components.texttoimg;

import javax.faces.component.UIComponent;
import javax.faces.webapp.UIComponentTag;

import tr.richfacesext.components.ComponentUtils;

/**
 * 
 * @author mert
 *
 */
public class TextToImgTag extends UIComponentTag {

	private String _value = null;
	private String _converter = null;
	private String _fontName = null;
	private String _fontStyle = null;
	private String _fontSize = null;
	private String _style = null;
	private String _onclick = null;

	public void release(){
		super.release();
		_value = null;
		_converter = null;
		_fontName = null;
		_fontStyle = null;
		_fontSize = null;
		_style = null;
		_onclick = null;
	}

	protected void setProperties(UIComponent uicomponent){
		super.setProperties(uicomponent);

		ComponentUtils.setValueProperty(getFacesContext(), uicomponent, _value);
		ComponentUtils.setConverterProperty(getFacesContext(), uicomponent, _converter);
		ComponentUtils.setStringProperty(getFacesContext(), uicomponent, "fontName", _fontName );
		ComponentUtils.setStringProperty(getFacesContext(), uicomponent, "fontStyle", _fontStyle );
		ComponentUtils.setIntegerProperty(getFacesContext(), uicomponent, "fontSize", _fontSize );
		ComponentUtils.setStringProperty(getFacesContext(), uicomponent, "style", _style );
		ComponentUtils.setStringProperty(getFacesContext(), uicomponent, "onclick", _onclick );
	}

	public String getComponentType() {
		return TextToImg.COMPONENT_TYPE;
	}

	public String getRendererType() {
		return "tr.richfacesext.components.texttoimg.TextToImgRenderer";
	}

	public void setValue(String value){
		_value = value;
	}

	public void setConverter(String value){
		_converter = value;
	}

	public void setFontName(String value){
		_fontName = value;
	}

	public void setFontStyle(String value){
		_fontStyle = value;
	}

	public void setFontSize(String value){
		_fontSize = value;
	}

	public void setStyle(String value){
		_style = value;
	}

	public void setOnclick(String value){
		_onclick = value;
	}

}